odoo.define('custom.CrashManager', function (require) {
    "use strict";

    var ajax = require('web.ajax');
    var core = require('web.core');
    var CrashManager = require('web.CrashManager').CrashManager;
    var Dialog = require('web.Dialog');

    var _t = core._t;
    var QWeb = core.qweb;
    var rpc = require("web.rpc");
    CrashManager.include({

        show_warning: function (error, options) {
            var self = this;

            // debugger;
            //error.data.name=="odoo.exceptions.UserError"   error.data.exception_type="user_error"
            // error.data.name=="odoo.exceptions.MissingError  error.data.exception_type="missing_error"
            // if (error.data.name.indexOf('UserError') !== -1) {
            //     error.type = "提示信息";
            // }
            debugger;
            if (error.data.exception_type === "user_error" || error.data.exception_type === "validation_error") {
                error.type = "提示信息";
            }
            //"missing_error"
            if (error.data.exception_type === "missing_error" || error.data.exception_type === "warning" || error.data.exception_type === "access_error") {
                error.type = "系统警告";
            }
            if (error.data.exception_type === "except_orm") {
                error.type = "系统异常错误";
            }
            return this._super.apply(this, arguments);
        },
    });
});